﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>判断上传文件的类型</title>
</head>
<body>
<input type=file onchange="alert(this.value.match(/^(.*)(\.)(.{1,8})$/)[3]+'类型')">
</body>
</html>